A Symmetric Approach to Compilation and Decompilation

نویسندگان

  • Mads Sig Ager
  • Olivier Danvy
  • Mayer Goldberg
چکیده

Just as an interpreter for a source language can be turned into a compiler from the source language to a target language, we observe that an interpreter for a target language can be turned into a compiler from the target language to a source language. In both cases, the key issue is the choice of whether to perform an evaluation or to emit code that represents this evaluation. We substantiate this observation with two source interpreters and two target interpreters. We first consider a source language of arithmetic expressions and a target language for a stack machine, and then the λcalculus and the SECD-machine language. In each case, we prove that the target-to-source compiler is a left inverse of the source-to-target compiler, i.e., that it is a decompiler. In the context of partial evaluation, the binding-time shift of going from a source interpreter to a compiler is classically referred to as a Futamura projection. By symmetry, it seems logical to refer to the bindingtime shift of going from a target interpreter to a compiler as a Futamura embedding. To Neil Jones, for his 60th birthday. ∗Basic Research in Computer Science (www.brics.dk), funded by the Danish National Research Foundation. †Ny Munkegade, Building 540, DK-8000 Aarhus C, Denmark. E-mail: {mads,danvy}@brics.dk ‡Be’er Sheva 84105, Israel. E-mail: [email protected]

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Improving the Decompilation of Java Bytecode to Prolog by Partial Evaluation

The interpretative approach to compilation allows compiling programs by partially evaluating an interpreter w.r.t. a source program. This approach, though very attractive in principle, has not been widely applied in practice mainly because of the difficulty in finding a partial evaluation strategy which always obtain “quality” compiled programs. In spite of this, in recent work we have performe...

متن کامل

Advanced Static Analysis for Decompilation Using Scattered Context Grammars

Reverse program compilation (i.e. decompilation) is a process heavily exploited in reverse engineering. The task of decompilation is to transform a platform-specific executable into a high-level language representation, which is usually the C language. Such a process can be used for source code reconstruction, compiler testing, malware analysis, etc. In present, there are several existing decom...

متن کامل

An Environment for the Reverse Engineering of Executable Programs

Reverse engineering of software systems has traditionally centered upon the generation of high-level abstractions or speciications from high-level code or databases. In this paper we report on a reverse engineering environment for low-level executable code: a reverse compilation or decompilation environment that aids in the understanding of the underlying executable program. The reverse compila...

متن کامل

Bugalyze.com - Detecting Bugs Using Decompilation and Data Flow Analysis

Detecting bugs in programs is important to establish trusthworthy software. To achieve this, static analysis on source code is a common approach to discover bugs. However, source code is not always available, as in the case of a black box penetration test. Even if source code is available, it still remains prudent to test that compilation and link editing has not introduced new bugs into the so...

متن کامل

Generic Reverse Compilation to Recognize Specific Behavior

This extended abstract of the doctoral thesis introduces the recognition of specific behavior by generic reverse compilation. The generic reverse compilation is a process that transforms executables from different architectures and object file formats to the same high level language. This process is covered by a tool Lissom Decompiler. For a purpose of behavior recognition, we introduce Languag...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2002